﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SuperSocket.ProtoBase
{
    /// <summary>
    /// The interface for Binary package info
    /// </summary>
    public interface IBinaryPackageInfo
    {
        /// <summary>
        /// Gets the Binary data.
        /// </summary>
        /// <value>
        /// The Binary data.
        /// </value>
        byte[] Data { get; }
    }
    /// <summary>
    /// Binary package info
    /// 
    /// </summary>
    /// <typeparam name="TKey">The type of the key.</typeparam>
    public class BinaryPackageInfo<TKey> : IPackageInfo<TKey>, IBinaryPackageInfo
    {
        /// <summary>
        /// Gets the key.
        /// </summary>
        /// <value>
        /// The key.
        /// </value>
        public TKey Key { get; }

        /// <summary>
        /// Gets the Binary data.
        /// </summary>
        /// <value>
        /// The Binary data.
        /// </value>
        public byte[] Data { get; }

        /// <summary>
        /// Initializes a new instance of the <see cref="BufferedPackageInfo{TKey}"/> class.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="data">The data.</param>
        public BinaryPackageInfo(TKey key, byte[] data)
        {
            Key = key;
            Data = data;
        }


    }
    /// /// <summary>
    /// Binary package info
    /// </summary>
    public class BinaryPackageInfo : BinaryPackageInfo<string>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="BufferedPackageInfo"/> class.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="data">The data.</param>
        public BinaryPackageInfo(string key, byte[] data)
            : base(key, data)
        {

        }
    }
}
